import React, { Component ,lazy,Suspense} from 'react';
import {Route,Redirect,Switch} from 'react-router-dom'
import './App.css'
var Index = lazy(()=> import('./views/Index'))
var Notfound = lazy(()=>import('./views/Notfound'))
class App extends Component {
  render() {
    return (
      <div className='app'>
         <Suspense fallback = {<div className='loading'></div>}>
               <Switch>
                  <Route path='/index' component={Index} />
                  <Redirect exact from='/' to='./index' />
                  <Route path='*' component={Notfound} />
               </Switch>
         </Suspense>
      </div>
    );
  }
}

export default App;